package com.study.services;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.study.model.jdao.IPayplanDAO;
import com.study.model.mdao.PayplanMapper;
import com.study.model.pojo.Payplan;

@Service
@Transactional(rollbackOn = Exception.class)
public class PayPlanService {
	@Autowired
	IPayplanDAO dao;
	@Autowired
	PayplanMapper mapper;
	/**
	 * 添加付款计划
	 * @param payplan
	 */
	public void insert(Payplan payplan) {
		dao.save(payplan);
	}
	
	/**
	 * 查询付款计划
	 * @param schno
	 * @return
	 */
	public JSONObject selectplan(Integer schno) {
		return mapper.findById(schno);
	}
	
	public void updatepay(Integer payid) {
		mapper.update(payid);
	}
}
